<?php

namespace App\Command\Tests;

use App\Constants\Rooms;
use App\Lib\Rooms\Services\RoomService;
use App\Model\UsersModel;
use Hyperf\Command\Annotation\Command;

/**
 * @Command()
 * Class RoomTests
 * @package App\Command\Tests
 */
class RoomTests extends BaseTests
{
    protected $name = 'test:room';


    /**
     * 创建房间
     */
    protected function create()
    {

        /** @var UsersModel $user */
        $user = UsersModel::query()->find(1);
        $room = $this->container->get(RoomService::class)->create(
            $user,
            [
                'type' => Rooms::TYPE_MAHJONG,
                'number' => 4,
                'score' => 10,
                'round_counts' => 1,
                'capping' => 0,
            ]
        );
        dump($room);
    }
}